
ReadME for Replication Files for "How the Geographic Clustering of Young and Highly Educated Voters Undermines Redistributive Politics"

Journal of Politics

September 3, 2023

Tom O'Grady
UCL
t.o'grady@ucl.ac.uk

Andreas Wiedemann
Princeton University
awiedemann@princeton.edu


### DETAILS OF THE MANUSCRIPT

Please note that the manuscript has changed since the version that was re-submitted to the JoP in January, due to some requests for further revisions. 
You should refer to the file "manuscript.pdf" on dataverse, as this is the version that should be matched by our replication code


### COMPUTING ENVIRONMENT USED

R version 4.3.1 (2023-06-16)Running under: Windows 10, 64-bit

R packages needed:
psych
tidyverse
corrplot
factoextra
brms
stringr
data.table
stargazer
matrixStats
zoo
reshape2
readstata13
readxl
sf
BBmisc
viridis
ggpubr
gridExtra
grid
lme4

RStan details:
Using this computer setup, running the brm models via RStan required us to first:

i. Install Rtools from https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html

ii. Remove prior versions of StanHeaders and rstan, then install latest versions using this code:
remove.packages(c("StanHeaders","rstan"))
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

You may be able to skip these steps if you already have a working RStan setup


### LIST OF FILES

Folder hierarchy
	data (contains all data files)
	code (contains the R script)
	output (contains intermediate output)
	figures (contains figures)	


### DOCUMENTATION

readme.txt -- This file, which lists all files and computing environment dependencies necessaryto verify the results from this manuscript

codebook.pdf -- combined codebook for all data files


### DATA FILES

bsa8320.dta           British Social Attitudes Survey data, 1983-2020
isspineq19.dta        ISSP inequality survey data, 2019
isspenv20.dta         ISSP environment survey data, 2020
bsa_harmon_final.csv  BSAS survey data, 1994-6
covars1996.csv        1996 local authority area covariates
yougov_final.csv      Yougov survey data (collected by us), 2020
covars2020.csv        2020 local authority area covariates
post96.Rda            Post-stratification data, 1996post20.Rda            Post-stratification data, 2020or UK
brexit_vote_LAD.csv   Brexit referendum results by local authority area, 2015
inflation.csv         CPI inflation rate, 1988-2020
loc_elec.Rda          Local election results for 1994-6 and 2018
loc_elec_19.Rda       Local election results for 2019
lookup_9619.csv       Lookup table to map 1996 local authority areas to 2020 boundaries
bsa20.Rda             British Social Attitudes Survey data, 2020


### CODE

Use the script in the folder "code" to reproduce all figures and tables in the main text and appendix. Set your working directory to the "replication" folder. The scripts include all relevant packages to run the code. The script draws on the datasets in the "data" folder and the "output" folder for intermediate MRP results. It saves figures and intermediate datasets in the "figure" and "output" folders as follows.

